package JDBC;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;

public class Jaxb {

	public static void main(String[] args) {
		JAXBContext ctx = null;
		Student student = new Student("qingke","male",20,1000,"Math");
		
		try {
			ctx = JAXBContext.newInstance(Student.class);//д
			ctx.createMarshaller().marshal(student, new File("student.xml"));
			
			Object obj = ctx.createUnmarshaller().unmarshal(new File("student.xml"));
			System.out.println(obj);
		} catch (JAXBException e) {

			e.printStackTrace();
		}
	}
}
